home *** CD-ROM | disk | FTP | other *** search
/ PC Answers 2003 September / PC Answers September 2003.iso / Software / trial / MonitorIT 5.2.06 / monitorit_fullsetup.exe / data1.cab / Js / WinServicesFunc.js < prev   
Encoding:
JavaScript  |  2003-06-24  |  2.6 KB  |  80 lines

  1. /* ======================================================================
  2. DESC: Common Win Servcies Functions for the Administer Operations
  3.  
  4. PLATFORMS: >= MS IE 4.0
  5.  
  6. USAGE NOTES: 
  7. ====================================================================== */
  8.  
  9. // Populate Display View with Computers and services for Associated Alert Group
  10.  
  11. // Process Read of Win Services Monitor Records by AGId
  12. var WSrvcsMonitorRecs = new Array();
  13. var WSrvcsMonitorRecLength = 5;
  14. var WSrvcsIndex = 0;
  15. function processPopulateWSTComputersContinue(coidstrg) {
  16.     var warr1 = new Array();
  17.     var wstat = new Array();
  18.     wstat = coidstrg.split(":");
  19.     if ( wstat[0] == "Err" ) {
  20.         top.Rstatus.Pstat("Error retrieving Win Services Monitoring record: "+wstat[1],true); 
  21.         ALupMode = ""; // reset
  22.         PINP_Bsy = false;
  23.         return;
  24.     }
  25.     WSrvcsMonitorRecs.length = 0; // reset array
  26.     WSrvcsMonitorRecs = coidstrg.split("~"); // parse out the NTservices Monitor records
  27.     WSrvcsIndex = 0; // Monitor Records Array Index
  28.     WSrvcsLinkIDRecs.length = 0; // Reset
  29.     WSrvcsLinkIDRecsIndex = 0; // LinkListID Records Array Index
  30.     prevWSCompID = "";
  31.     processWServicesLinkIDLookup();
  32. }
  33.  
  34. // Get Computer and Service for each NT services Link record
  35. var CommObj = null;
  36. function processWServicesLinkIDLookup() {
  37.     var ArgStr = "";
  38.     while ( WSrvcsIndex < WSrvcsMonitorRecs.length-1 ) { 
  39.         ArgStr += WSrvcsMonitorRecs[WSrvcsIndex+2]+"~";
  40.         WSrvcsIndex += WSrvcsMonitorRecLength;
  41.     }
  42.     if ( CommObj.NTServicesLinkListLookupByID( ArgStr ) ) { 
  43.         // if unable to initiate request        
  44.         ALupMode = ""; // reset
  45.         PINP_Bsy = false;
  46.         top.Rstatus.Pstat("Unable to start the Win Services Computer LOOKUP request",true);
  47.     }
  48. }
  49.  
  50. // Process each NT services Link Record
  51. var WSrvcsLinkIDRecs = new Array();
  52. var WSrvcsLinkIDRecsIndex = 0;
  53. var WSrvcsLinkIDRecsLength = 3;
  54. var prevWSCompID = "";
  55. function processWServicesLinkIDLookupRecord(WSLIDrec) {
  56.     var warr = new Array();
  57.     var warr1 = new Array();
  58.     var carr = new Array();
  59.     
  60.     warr1 = WSLIDrec.split(";");
  61.     for ( var i=0; i<warr1.length; i++ ) {
  62.         warr = warr1[i].split("~");
  63.         WSrvcsLinkIDRecs[ WSrvcsLinkIDRecsIndex++ ] = warr[1]; //Services List ID
  64.         WSrvcsLinkIDRecs[ WSrvcsLinkIDRecsIndex++ ] = warr[2]; //Computer ID
  65.         WSrvcsLinkIDRecs[ WSrvcsLinkIDRecsIndex++ ] = warr[0]; //Services Link ID
  66.         carr[i] = warr[2]; // Computer ID
  67.     }
  68.     carr.sort(); // sort the ComputerIDs
  69.     for ( var i=0; i<carr.length; i++ ) {
  70.         if ( carr[i] != prevWSCompID ) {
  71.             if ( ++CountOfCompsRcvd > 1) {
  72.                  CompIdLupArr += ","; // Computer Id Array
  73.             }
  74.             CompIdLupArr += carr[i]; // Computer Id Array
  75.             prevWSCompID = carr[i];
  76.         }
  77.     }    
  78.     processWinServicesClupDone();
  79. }
  80.